package com.kata.chapter4;

/**
 * Created by Solidsnake on 2014/11/17. <br>
 * 懒单例模式 : <br>
 * 懒皇帝, 需要时再立一个, 不需要时就不去管它 <br>
 * 民主国家专属技能 <br>
 */
public class LazyEmperor {

    public static LazyEmperor target;

    private LazyEmperor() {
        System.out.println("哥当皇帝了!!");
    }

    public static LazyEmperor getEmperor() {
        if(target == null) {
            target = new LazyEmperor();
        }
        return target;
    }
}
